<%--                                                                       --%>
<%-- Copyright (c) 2002-2003 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries.                       --%>
<%--                                                                       --%>

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>


<script language=JavaScript>
<!--

// Gets user's confirmation to delete the checklist
function confirmDeleteChecklist() 
{
  if (confirm('<bean:message key="cs.checklist.confirmDelete"/>')) 
  {
    return true;
  }
  else 
  {
    return false;
  }
}

function onClickSwitchPhase(theForm) {
  theForm.displayPhaseId.value = theForm.elements['urlParams.displayPhaseId'].value;
  theForm.submit();
}

// -->
</script>
<!-- Zone 5 starts here.  -->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" 
         summary="content area">
  <tr>
    <td valign="top">
    
    <div class="pageTitle">
      <%@ include file="/cs/microsite/micrositeNaviInfo.jsp" %>
    </div> 
    
    <!--end page title area here-->

    <!--  BEGIN form { switch phase } ----------------------------- -->
    <div class="generalWrapRight">
      <logic:equal name="micrositeNaviInfoView" property="micrositeTemplatePhaseFlag" value="true">
      <html:form action="/cs/checklistList.do" method="post">

          <bvhtml:hiddenList name="micrositeNaviInfoView" property="urlParams" scope="request"/>
          <html:select name="micrositeNaviInfoView" property="urlParams.displayPhaseId" size="1">  
            <bean:define id="allPhasesList" name="checklistListView" property="allPhasesList" />
            <html:optionsCollection name="checklistListView" property="allPhasesList"/>
            <html:option value="0"><bean:message key="cs.phases.all"/></html:option>
          </html:select>&nbsp;    
      
          <input type="button" class="titleButton" 
                 onclick="onClickSwitchPhase(this.form)"
                 value="<bean:message key='button.go'/>" 
                 titleKey="button.go">
        </html:form>
      </logic:equal>
    </div> 
    <!--  END form { switch phase } ----------------------------- -->  
      
    <div class="pageSubtitle">
      <span class="left">
        <bean:message key="cs.checklist.index"/>
      </span>
      <logic:notEqual name="checklistListView" property="isReadOnly" value="true">
        <span class="right">
          <html:form action="/cs/checklistNew.do" method="post">

            <bvhtml:hiddenList name="micrositeNaviInfoView" property="urlParams" scope="request"/>
            <input type="submit" class="titleButton" name="newBtn"
                 value='<bean:message key="button.createNew"/>' >
          </html:form>       
        </span>
      </logic:notEqual>
    </div> 
    
    <div class="blockWrap">
    
    <!--end title bar here-->

    <!-- Start List here -->
    <table class="dataTable" border="0" cellspacing="1" cellpadding="2" 
           summary="Checklist list table" width="100%">
      <tr class="listHeader"> 
        <th id="Name" align="left"> <bean:message key="cs.name"/> </th>
        <th id="Owner" align="left"><bean:message key="cs.owner"/></th>
        <th id="DueDate" align="left"><bean:message key="cs.checklist.dueDate"/></th>
        <th id="Status" align="left"><bean:message key="cs.checklist.status"/></th>
        <th id="Action" align="left"><bean:message key="cs.actions"/></th>
      </tr>
    
      <!--start checklists iteration here-->  
      <logic:iterate id="oneChecklist" name="checklistListView"
                     property="checklistDTOList" indexId="index">
        <tr class='<%=index.intValue() %2 == 0 ? "listEven" : "listOdd"%>'>
          <td headers="Name" align="left" >
            <html:link page="/cs/checklistTaskList.do" name="oneChecklist" property="urlParams">
              <bean:write name="oneChecklist" property="name"/>
            </html:link><br>
            <bean:write name="oneChecklist" property="description"/> 
          </td>
          <td headers="Owner" align="left" >
            <bean:write name="oneChecklist" property="ownerName"/>
          </td>
          <td headers="DueDate" align="left" >
            <bean:write name="oneChecklist" property="dueDate" formatKey="format.datetime.tasklist"/>
          </td>
          <td headers="Status" align="left" >
            <logic:equal name="oneChecklist" property="completionStatus" value="0">
              <bean:message key="cs.status.active"/> 
            </logic:equal>
            <logic:equal name="oneChecklist" property="completionStatus" value="1">
              <bean:message key="cs.status.pending"/> 
            </logic:equal>
            <logic:equal name="oneChecklist" property="completionStatus" value="2">
              <bean:message key="cs.status.completed"/> 
            </logic:equal>
            <logic:equal name="oneChecklist" property="completionStatus" value="3">
              <bean:message key="cs.status.deferred"/> 
            </logic:equal>
            <logic:equal name="oneChecklist" property="completionStatus" value="4">
              <bean:message key="cs.status.notask"/> 
            </logic:equal>
          </td>
          <td headers="Action" nowrap align="left" >
            <logic:notEqual name="oneChecklist" property="isReadOnly" value="true">
              <logic:equal name="oneChecklist" property="isOwner" value="true">
                <html:link page="/cs/checklistEdit.do" name="oneChecklist" property="urlParams"><html:img page="/cs/images/action/icon_edit.gif" styleClass="actionIcon" altKey="cs.image.alt.edit" border="0"/></html:link>
                <html:link page="/cs/checklistDelete.do" name="oneChecklist" property="urlParams" onclick="return confirmDeleteChecklist()"><html:img page="/cs/images/action/icon_delete.gif" styleClass="actionIcon" altKey="cs.image.alt.delete" border="0"/></html:link>
              </logic:equal>
            </logic:notEqual>
            &nbsp;
          </td>
        </tr>
      </logic:iterate> 
      <logic:equal name="checklistListView" property="checklistDTOList.empty" value="true">
        <tr class="listOdd">
          <td align="center" colspan="5">
            <bean:message key="cs.collaboration.noChecklists"/>
          </td>
        </tr>
      </logic:equal>

    <!--end checklists alteration here-->  
    </table>
    </div>
    
  </td>
  </tr>
</table>
<!--end zone 5 content here -->  
